
package com.jf.cloud.multishop.mapper;

import com.jf.cloud.multishop.dto.ShopWithdrawCashDTO;
import com.jf.cloud.multishop.model.ShopWithdrawCash;
import com.jf.cloud.multishop.vo.ShopWithdrawCashLogExcelVO;
import com.jf.cloud.multishop.vo.ShopWithdrawCashVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 商家提现申请信息
 *
 * @author zz
 * @date 2021-01-07 16:41:03
 */
public interface ShopWithdrawCashMapper {

    /**
     * 获取商家提现申请信息列表
     * @return 商家提现申请信息列表
     */
    List<ShopWithdrawCash> list();

    /**
     * 根据商家提现申请信息id获取商家提现申请信息
     *
     * @param cashId 商家提现申请信息id
     * @return 商家提现申请信息
     */
    ShopWithdrawCash getByCashId(@Param("cashId") Long cashId);

    /**
     * 保存商家提现申请信息
     * @param shopWithdrawCash 商家提现申请信息
     */
    void save(@Param("shopWithdrawCash") ShopWithdrawCash shopWithdrawCash);

    /**
     * 更新商家提现申请信息
     * @param shopWithdrawCash 商家提现申请信息
     */
    void update(@Param("shopWithdrawCash") ShopWithdrawCash shopWithdrawCash);

    /**
     * 根据商家提现申请信息id删除商家提现申请信息
     * @param cashId
     */
    void deleteById(@Param("cashId") Long cashId);

    /**
     * 根据银行卡id与商家提现申请状态获取商家提现申请数量
     * @param shopBankCardId 银行卡id
     * @param status 提现申请状态
     * @return
     */
    int countByShopBandCardIdAndStatus(@Param("shopBankCardId") Long shopBankCardId, @Param("status") Integer status);

    /**
     * 根据参数获取提现记录列表
     * @param shopWithdrawCashDTO 搜索筛选参数
     * @return 提现记录列表
     */
    List<ShopWithdrawCashVO> listByParam(@Param("shopWithdrawCash") ShopWithdrawCashDTO shopWithdrawCashDTO);

    List<ShopWithdrawCashLogExcelVO> listShopWithdrawCashLogExcel(@Param("shopWithdrawCash") ShopWithdrawCashDTO shopWithdrawCashDTO);

    /**
     * 根据id获取提现申请详情信息
     * @param cashId
     * @return
     */
    ShopWithdrawCashVO getDetailByCashId(@Param("cashId") Long cashId);

    /**
     * 根据id与状态更新提现申请信息
     * @param shopWithdrawCash
     * @param cashId
     * @param status
     * @return
     */
    int updateByIdAndStatus(@Param("shopWithdrawCash") ShopWithdrawCash shopWithdrawCash, @Param("cashId") Long cashId, @Param("status") Integer status);

    int getWithdrawCashCount(@Param("startTimes") Date startTimes, @Param("endTimes") Date endTimes,@Param("shopWithdrawCash") ShopWithdrawCash shopWithdrawCash);
}
